// Copyright (c) 2002 HTHK
package admin.menu;

import com.ffpc.sql.*;

public class UserFunctionView
   extends DataObject
   implements UserFunctionViewBean
{
   private String user_id = null;
   private String func_id = null;
   private String func_name = null;
   private String parent_id = null;
   private String url = null;
   private String division = null;
   private String sequence = null;
   private String parent_fg = null;
   private Column ColUserId = null;
   private Column ColFuncId = null;
   private Column ColFuncName = null;
   private Column ColParentId = null;
   private Column ColUrl = null;
   private Column ColDivision = null;
   private Column ColSequence = null;
   private Column ColParentFg = null;
   /**
    * Constructor
    */
   public UserFunctionView()
   {
       ColUserId = new Column(0,"user_id",Column.Types.string,null,20,false);
       ColFuncId = new Column(1,"func_id",Column.Types.string,null,10,false);
       ColFuncName = new Column(2,"func_name",Column.Types.string,null,50,false);
       ColParentId = new Column(3,"parent_id",Column.Types.string,null,10,true);
       ColUrl = new Column(4,"url",Column.Types.string,null,100,true);
       ColDivision = new Column(5,"division",Column.Types.string,null,100,true);
       ColSequence = new Column(6,"sequence",Column.Types.number,null,22,true);
       ColParentFg = new Column(7,"parent_fg",Column.Types.string,null,1,true);
   }

   // functions belongs to UserFunctionViewBean interface

   @Override
public void setUser_id(String user_id)
   {       this.user_id = this.setAttribute(ColUserId,user_id);
   }

   @Override
public String getUser_id()
   {       return this.user_id==null?"":this.user_id;
   }

   @Override
public void setFunc_id(String func_id)
   {       this.func_id = this.setAttribute(ColFuncId,func_id);
   }

   @Override
public String getFunc_id()
   {       return this.func_id==null?"":this.func_id;
   }

   @Override
public void setFunc_name(String func_name)
   {       this.func_name = this.setAttribute(ColFuncName,func_name);
   }

   @Override
public String getFunc_name()
   {       return this.func_name==null?"":this.func_name;
   }

   @Override
public void setParent_id(String parent_id)
   {       this.parent_id = this.setAttribute(ColParentId,parent_id);
   }

   @Override
public String getParent_id()
   {       return this.parent_id==null?"":this.parent_id;
   }

   @Override
public void setUrl(String url)
   {       this.url = this.setAttribute(ColUrl,url);
   }

   @Override
public String getUrl()
   {       return this.url==null?"":this.url;
   }

   @Override
public void setDivision(String division)
   {       this.division = this.setAttribute(ColDivision,division);
   }

   @Override
public String getDivision()
   {       return this.division==null?"":this.division;
   }

   @Override
public void setSequence(String sequence)
   {       this.sequence = this.setAttribute(ColSequence,sequence);
   }

   @Override
public String getSequence()
   {       return this.sequence==null?"":this.sequence;
   }

   @Override
public void setParent_fg(String parent_fg)
   {       this.parent_fg = this.setAttribute(ColParentFg,parent_fg);
   }

   @Override
public String getParent_fg()
   {       return this.parent_fg==null?"":this.parent_fg;
   }

   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[8];
       cols[0] = ColUserId.clone(null);
       cols[1] = ColFuncId.clone(null);
       cols[2] = ColFuncName.clone(null);
       cols[3] = ColParentId.clone(null);
       cols[4] = ColUrl.clone(null);
       cols[5] = ColDivision.clone(null);
       cols[6] = ColSequence.clone(null);
       cols[7] = ColParentFg.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "jis.jis_v_user_function";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "user_id"
                         ,"func_id"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "func_name"
                         ,"parent_id"
                         ,"url"
                         ,"division"
                         ,"sequence"
                         ,"parent_fg"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.user_id = this.retrieveColumnValue("user_id");
       this.func_id = this.retrieveColumnValue("func_id");
       this.func_name = this.retrieveColumnValue("func_name");
       this.parent_id = this.retrieveColumnValue("parent_id");
       this.url = this.retrieveColumnValue("url");
       this.division = this.retrieveColumnValue("division");
       this.sequence = this.retrieveColumnValue("sequence");
       this.parent_fg = this.retrieveColumnValue("parent_fg");
   }
}

